<div class="view-header">
    <div class="view-header-left">
        <div ng-show="!add_cover&&!insurance_cover&&!place_order_open">
            <div class="search-shop">
                <i class="fa fa-home"></i>
                <shop-picker class="from-control" shop="search_params.shop"></shop-picker>
            </div>

            <div class="search-date">
                <i class="fa fa-calendar search-date-i"></i>
                <datetimepicker class="search-date-start"
                                min-view="2"
                                end-date="search_params.date_end"
                                ng-model="search_params.date_start"></datetimepicker>

            </div>
            <div class="search-date">
                <i class="fa fa-calendar search-date-i"></i>
                <datetimepicker class="search-date-end"
                                min-view="2"
                                start-date="search_params.date_start"
                                ng-model="search_params.date_end"></datetimepicker>
            </div>
        </div>
        <div class="view-header-left">
            <!-- 查询 -->
            <div class="view-header-item no-widen"
                 ng-show = "!add_open"
                 ng-click="refresh()" title="查询" >
                <i class="fa fa-search"></i>
            </div>
            <div class="view-header-item color-open"
                 ng-show = "!add_open&&selected_visit.id"
                 ng-click="add_test_drive();add_open = !add_open" title="新增试驾" >
                <i class="fa fa-plus"></i> 新增试驾
            </div>
            <div class="view-header-item color-open above-cover no-widen"
                 ng-show = "add_open"
                 ng-click= "add_open = !add_open" title="关闭" >
                <i class="fa fa-close"></i>
            </div>
            <div class="view-header-item color-check above-cover no-widen"
                 ng-show = "add_open"
                 ng-click= "submit();add_open = !add_open" title="提交" >
                <i class="fa fa-upload"></i>
            </div>
        </div>
    </div>
</div>
<div class="view-content ">
        <div ag-grid="grid_visit" class="ag-material"
             style="height :50%"></div>
        <div ag-grid="grid_test_drive" class="ag-material "
             style="height :50%"></div>

</div>

<!-- 新增弹出 -->


<div class="data-overlay" ng-show='add_open'>
    <div class="overlay-container">
        <div class="overlay-header">新增试驾</div>
        <form-reception ng-model="selected_visit" form="forms.selected_visit" mode="forms.only_test_drive"></form-reception>
    </div>
</div>
<!-- <div class="data-overlay" ng-show='add_open'>
    <div class="overlay-container">
        <div class="overlay-header">新增试驾</div>
        <div ng-form name="reception_add" novalidate="novalidate">
            <div class="overlay-content">
                <div class="overlay-column overlay-column-3">
                    <div class="overlay-item">
                        <span class="overlay-name">日期</span>
                        <input type="text" value="{{selected_visit.arrive_time | date:'yyyy-MM-dd'}}" disabled>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">到店时间</span>
                        <input type="text" value="{{selected_visit.arrive_time | date:'hh:mm'}}" disabled>
                    </div>

                    <div class="overlay-item">
                        <span class="overlay-name">离店时间</span>
                        <input type="text" value="{{selected_visit.exit_time | date:'hh:mm'}}" disabled>

                    </div>

                    <div class="overlay-item">
                        <span class="overlay-name">顾问（潜客）</span>
                        <input type = "text" ng-model="selected_visit.owner_id" disabled>
                    </div>

                    <div class="overlay-item">
                        <span class="overlay-name">顾问（流量）</span>
                        <input type = "text" ng-model="selected_visit.salesman_name" disabled>
                    </div>

                    <div class="overlay-item">
                        <span class="overlay-name">销售门店</span>
                        <input type="text"
                               ng-model="selected_visit.sales_shop_name"
                               disabled>
                    </div>
                </div>
                <div class="overlay-column overlay-column-3">
                    <div class="overlay-item">
                        <span class="overlay-name">姓名</span>
                        <input type="text"
                               placeholder="name" ng-model="selected_visit.name" disabled>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">性别</span>
                        <select ng-model="selected_visit.sex" disabled>
                            <option value="1">男</option>
                            <option value="2">女</option>
                        </select>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">联系电话</span>
                        <input type="text" ng-model="selected_visit.phone"
                               name = "phone" disabled>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">兴趣爱好</span>
                        <input type="text" ng-model="selected_visit.habit" disabled>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">客户区域</span>
                        <select ng-model="selected_visit.region" disabled>
                            <option value="新区">新区</option>
                            <option value="姑苏">姑苏</option>
                            <option value="园区">园区</option>
                            <option value="相城">相城</option>
                            <option value="吴中">吴中</option>
                            <option value="吴江">吴江</option>
                            <option value="常熟">常熟</option>
                            <option value="外区">外区</option>
                        </select>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">来源</span>
                        <select ng-model="selected_visit.source" disabled>
                            <option value="1">路过</option>
                            <option value="2">网络</option>
                            <option value="3">广电</option>
                            <option value="4">基盘</option>
                            <option value="5">活动</option>
                            <option value="6">介绍</option>
                        </select>
                    </div>
                    <div class="overlay-item" style="border:1px solid red;">
                        <span class="overlay-name">试乘试驾</span>
                        <select ng-model="selected_visit.is_test_drive" disabled>
                            <option value="1">是</option>
                            <option value="0">否</option>
                        </select>

                        <div ng-show = "selected_visit.is_test_drive == 1" >
                            <vehicle-demo-picker
                                    ng-model="selected_visit.vehicle_demo" ></vehicle-demo-picker>
                            <input type="text" placeholder="驾驶员" ng-model="selected_visit.test_driver" >

                            <datetimepicker placeholder="开始时间"
                                            format="hh:ii"
                                            start-view="1"
                                            start-date="selected_visit.arrive_time"
                                            end-date="selected_visit.test_end_time"
                                            ng-model="selected_visit.test_start_time"></datetimepicker>
                            <datetimepicker placeholder="结束时间"
                                            format="hh:ii"
                                            start-view="1"
                                            start-date="selected_visit.test_start_time"
                                            ng-model="selected_visit.test_end_time"></datetimepicker>

                            <input type="number" placeholder="起始公里数" ng-model="selected_visit.vehicle_demo.mileage" disabled>
                            <input type="number" step="0.1" min="0" placeholder="结束公里数"
                                   ng-model="selected_visit.mileage_after">
                        </div>

                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">购买性质</span>
                        <select ng-model="selected_visit.replacement_assessment"
                                 disabled>

                            <option value="0">首购</option>
                            <option value="1">增购</option>
                            <option value="2">换购</option>

                        </select>
                    </div>
                    <div class="overlay-item">
                        <span class="overlay-name">接触方式</span>
                        <select ng-model="selected_visit.meeting_type"
                                name="meeting_type" disabled>
                            <option value="showroom">展厅</option>
                            <option value="dcc">DCC</option>
                        </select>
                    </div>
                    <div class="overlay-item" ng-show="selected_visit.meeting_type=='showroom'">
                        <span class="overlay-name">接触性质</span>
                        <select ng-model="selected_visit.entrance_type" disabled>
                            <option value="1">首次进入</option>
                            <option value="2">再次进入</option>
                            <option value="4">订单后</option>
                            <option value="3">非购车用户</option>
                        </select>
                    </div>
                    <div class="overlay-item" ng-show="selected_visit.meeting_type=='dcc'">
                        <span class="overlay-name">接触性质</span>
                        <select ng-model="selected_visit.entrance_type" disabled>
                            <option value="5">在途</option>
                            <option value="6">邀约到店</option>
                            <option value="2">再次进入</option>
                            <option value="4">订单后</option>
                        </select>
                    </div>
                </div>

                <div class="overlay-column overlay-column-3">
                    <div class="overlay-item">
                        <span class="overlay-name">客户级别</span>
                        <select ng-model="selected_visit.customer_level" disabled>
                            <option value=""></option>
                            <option value="O" ng-show="selected_visit.entrance_type != 5">O (订单)</option>
                            <option value="H">H (一周内）</option>
                            <option value="A">A (二周内）</option>
                            <option value="B">B (一个月）</option>
                            <option value="C">C (二个月）</option>
                            <option value="N">N (首次接触）</option>
                        </select>
                    </div>

                    <div class="overlay-item" ng-show="selected_visit.customer_level !='O'">
                        <span class="overlay-name">意向车型</span>
                        <vm-selector vehicle-model="add_vehicle"
                                     level="1"
                                ></vm-selector>
                    </div>
                </div>
            </div>
            <div class=" overlay-item help-doc" ng-show="toggle_help"></div>
        </div>
    </div>
</div> -->